package com.duleme.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/test")
public class testServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String recieve=req.getParameter("phone");
        String sex=req.getParameter("sex");
        String birthday=req.getParameter("birthday");
        String email=req.getParameter("email");
        System.out.println(recieve);
        System.out.println(sex);
        System.out.println(birthday);
        System.out.println(email);
        resp.getWriter().print(1);
    }

    public static void main(String[] args){
//        List<UserInfo> userInfos=new ArrayList<>();
//        UserInfo user1=new UserInfo();
//        user1.setId("34252219970135222x");
//        user1.setBirthday(new Date());
//        user1.setEmailAddress("222@qq.com");
//        user1.setName("wxy");
//        user1.setPhoneNumber("13343331212");
//        user1.setSex(0);
//        user1.setUserId(1);
//        UserInfo user2=new UserInfo();
//        user2.setId("34252219970135222x");
//        user2.setBirthday(new Date());
//        user2.setEmailAddress("222@qq.com");
//        user2.setName("SGN");
//        user2.setPhoneNumber("13343331212");
//        user2.setSex(1);
//        user2.setUserId(2);
//        userInfos.add(user1);
//        userInfos.add(user2);
//        String json=new JsonUtils().userInfos2Json(userInfos);
//
//        System.out.printf(json);
    }

}
